/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.aeo.bll;
import java.util.ArrayList;
/**
 * @author Frederic Branczyk & Robert Piwonski
 */
public class Course {
    
    private ArrayList<Student> studentList;
    private ArrayList<Student> alternative;
    private String name;
    private int time;
    private Subject subject;
    private Boolean changeable;
    private Course twinCourse;
    private boolean justConcept;
    
    public Course(ArrayList<Student> studentList, String name, int time, Subject subject) {
        this.studentList = studentList;
        this.alternative = new ArrayList<Student>();
        this.name = name;
        this.time= time;
        this.subject = subject;
        this.changeable = false;
        this.justConcept = true;
    }
    public Course(ArrayList<Student> studentList, ArrayList<Student> alternative, String name, int time, Subject subject) {
        this.studentList = studentList;
        this.alternative = alternative;
        this.name = name;
        this.time= time;
        this.subject = subject;
        this.changeable = true;
        this.justConcept = false;
    }
    
    public ArrayList<Student> getStudentList() {
        return studentList;
    }
    
    public void setStudentList(ArrayList<Student> studentList) {
        this.studentList = studentList;
    }
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public Subject getSubject() {
        return subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }
    
    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }
    
    public Course getTwin() {
        return this.twinCourse;
    }

    public void setTwin(Course twinCourse) {
        this.twinCourse = twinCourse;
    }
        public ArrayList<Student> getAlt() {
        return this.alternative;
    }

    public void setAlt(ArrayList<Student> alternative) {
        this.alternative = alternative;
    }
    
    public Boolean getChangeable() {
        return this.changeable;
    }

    public void setUnChangeable() {
        this.changeable = false;
    }
    
    public boolean isJustConcept() {
        return justConcept;
    }
    
    @Override
    public String toString() {
        String alt = "0";
        if(this.justConcept){
           return this.name; 
        }
        else{
            if(this.alternative!=null){
                alt=Integer.toString(this.alternative.size());
            }
            return this.name+" ("+this.studentList.size()+" + "+alt+"/"+this.subject.getMaxStudents()+")";
        }
    }
    
}
